package com.cd.music.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * @author yxl 余秀良
 * @version 1.0
 * @description: 用户登录记录表
 * @date 2018年03月01日  上午9:42
 * @address: 四川成都
 */
@Entity
@Table
public class UserLoginRecord implements Serializable {

    private static final long serialVersionUID = -5474983549857818434L;

    /**
     * 主键id
     */
    @Id
    @Column(nullable = false, length = 32, unique = true, name = "id")
    private String id;
    /**
     * 用户id
     */
    @Column(name = "userId", length = 32, nullable = false)
    private String userId;
    /**
     * 手机号码
     */
    @Column(name = "phone", length = 11, nullable = false)
    @Pattern(regexp = "^(13[0-9]|15[0-3,5-9]|17[0135678]|18[0-9]|19[89])\\d{8}$")
    private String phone;
    /**
     * 身份类型
     */
    @Column(name = "identityType", length = 20, columnDefinition = "nvarchar(20)")
    private String identityType;
    /**
     * 创建时间
     */
    @Column(name = "createTime", columnDefinition = "datetime default now()")
    private Date createTime;
    /**
     * id地址
     */
    @Column(name = "ipAddress", length = 30, columnDefinition = "nvarchar(30)")
    private String ipAddress;
    /**
     * 设备类型
     */
    @Column(name = "deviceType", length = 20, columnDefinition = "nvarchar(20)")
    private String deviceType;
    /**
     * 设备型号
     */
    @Column(name = "deviceModel", length = 20, columnDefinition = "nvarchar(20)")
    private String deviceModel;
    /**
     * 登录位置
     */
    @Column(name = "position", length = 200, columnDefinition = "nvarchar(200)")
    private String position;

    /**
     * 备注
     */
    @Column(name = "remark", length = 200)
    private String remark;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    public String getDeviceModel() {
        return deviceModel;
    }

    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getIdentityType() {
        return identityType;
    }

    public void setIdentityType(String identityType) {
        this.identityType = identityType;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
